package router

import (
	"github.com/gogf/gf/v2/net/ghttp"
	"server-asset/internal/controller/postman"
)

func Init(s *ghttp.Server) {
	s.Group("/api/v1", func(apiGroup *ghttp.RouterGroup) {
		// 统一跨域处理
		apiGroup.Middleware(ghttp.MiddlewareCORS)
		// JWT验证中间件
		//middleware.JwtAuth(r)
		// 请求日志记录
		//middleware.AccessLog(r)
		//group.Middleware.Next()

		// 注册各模块路由
		//注册项目路由
		registerProjectRoutes(apiGroup)
		//注册服务器路由
		registerServerRoutes(apiGroup)
		// 注册部署路由
		registerDeploymentRoutes(apiGroup)

	})

	s.BindHandler("GET:/postman", postman.NewPostman().Postman)
	s.BindHandler("GET:/docs", postman.NewPostman().GetSwagger)
	s.BindHandler("GET:/gofream", postman.NewPostman().GetDocument)

}
